<template>
	<view class="container">
		<view class="title">{{title}}</view>
		<rich-text :nodes="detail"></rich-text>	
	</view>
</template>

<script>
	import { getArticleDetail } from '@/utils/teacher.js'
	export default{
		props:{
			typeId: {
				type: Number
			}
		},
		onLoad(options) {
			if (options?.typeId) {
				this.typeId = options?.typeId
				this.$nextTick(() => {
					this.getDetail()
				})
			}
		},
		data(){
			return{
				detail: '',
				typeId: 1,
				title: null
			}
		},
		methods:{
			getDetail(){
				getArticleDetail({id:this.typeId}).then((res) => {
					console.log(22, res)
					if (res?.code === 1) {
						this.title = res?.result?.title
						this.detail = res?.result?.content
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container{
		padding:10rpx 48rpx;
		// width:100%;
		height:100%;
		background: #ffffff;
		.title{
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 60rpx;
			color: #2C333E;
      width: 100%;
      text-align: center;
      margin-bottom: 20rpx;
		}
		.desc{
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #2C333E;
			line-height: 35rpx;
			text-align: justified;
			font-style: normal;
			margin-top:29rpx;
		}
		
	}
</style>